import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTable;
import javax.swing.JLabel;
import javax.swing.border.LineBorder;
import java.awt.Color;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;
import javax.swing.JButton;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JList;
import javax.swing.AbstractListModel;


public class CalendarioConsultas extends JFrame {

	private JPanel contentPane;
	private JTable tableCalendario;
	private JTextField textCedulaM;
	private JTextField textNombreM;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					CalendarioConsultas frame = new CalendarioConsultas();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public CalendarioConsultas() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 750, 480);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		tableCalendario = new JTable();
		tableCalendario.setModel(new DefaultTableModel(
			new Object[][] {
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
				{null, null, null, null, null},
			},
			new String[] {
				"Fecha", "Turno", "Especialidad", "Cedula Paciente", "Nombre Paciente"
			}
		));
		tableCalendario.getColumnModel().getColumn(2).setPreferredWidth(80);
		tableCalendario.getColumnModel().getColumn(3).setPreferredWidth(100);
		tableCalendario.getColumnModel().getColumn(4).setPreferredWidth(100);
		tableCalendario.setBorder(new LineBorder(new Color(0, 0, 0)));
		tableCalendario.setBounds(52, 131, 630, 144);
		contentPane.add(tableCalendario);
		
		JLabel lblCalendario = new JLabel("Calendario");
		lblCalendario.setBounds(10, 11, 86, 20);
		contentPane.add(lblCalendario);
		
		JLabel lblCedulaDelMedico = new JLabel("Cedula del Medico:");
		lblCedulaDelMedico.setBounds(10, 42, 124, 14);
		contentPane.add(lblCedulaDelMedico);
		
		JLabel lblNombreDelMedico = new JLabel("Nombre del Medico:");
		lblNombreDelMedico.setBounds(10, 67, 143, 14);
		contentPane.add(lblNombreDelMedico);
		
		textCedulaM = new JTextField();
		textCedulaM.setEnabled(false);
		textCedulaM.setBounds(120, 39, 124, 20);
		contentPane.add(textCedulaM);
		textCedulaM.setColumns(10);
		
		textNombreM = new JTextField();
		textNombreM.setEnabled(false);
		textNombreM.setBounds(120, 67, 124, 20);
		contentPane.add(textNombreM);
		textNombreM.setColumns(10);
		
		JButton btnLimpiar = new JButton("Limpiar");
		btnLimpiar.setBounds(447, 375, 89, 23);
		contentPane.add(btnLimpiar);
		
		JButton btnAtras = new JButton("Atras");
		btnAtras.addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent arg0) {
				RegistroMedico obj=new RegistroMedico();
				obj.setVisible(true);
				dispose();
			}
		});
		btnAtras.setBounds(563, 375, 89, 23);
		contentPane.add(btnAtras);
		
		JLabel lblHorario = new JLabel("Horario:");
		lblHorario.setBounds(288, 14, 73, 14);
		contentPane.add(lblHorario);
		
		JList lstHorario = new JList();
		lstHorario.setBorder(new LineBorder(new Color(0, 0, 0)));
		lstHorario.setModel(new AbstractListModel() {
			String[] values = new String[] {"Clinica", "Turno", "Dias"};
			public int getSize() {
				return values.length;
			}
			public Object getElementAt(int index) {
				return values[index];
			}
		});
		lstHorario.setBounds(358, 40, 242, 50);
		contentPane.add(lstHorario);
	}
}
